import {setCurrentLang} from '../../utils/i18nUtil';
import {HomeData} from '../common/floorData';
import {LANG} from '../i18n/i18n.def';
// import {AboutUsPartData, fetchAboutUsData} from './aboutUs/aboutUsData';
// import {ContactUsPartData, fetchContactUsData} from './contactUs/contactUsData';
// import {DownloadPartData, fetchDownloadData} from './download/downloadData';
// import {fetchNewsListData, NewsListPartData} from './newsList/newsListData';
// import {fetchProductListData, ProductListPartData} from './productList/productListData';

// export type PagePartData = AboutUsPartData | ContactUsPartData | DownloadPartData | NewsListPartData | ProductListPartData;

// const pageType_fetchPartData_map: {[key in PAGE_TYPE]: (params?: any, data?: HomeData) => Promise<PagePartData>} = {
// 	AboutUs: fetchAboutUsData,
// 	ContactUs: fetchContactUsData,
// 	Products: fetchProductListData,
// 	Download: fetchDownloadData,
// 	News: fetchNewsListData,
// 	ProductCategory: fetchProductListData,
// 	DownloadCategory: fetchDownloadData,
// 	NewsCategory: fetchNewsListData,
// 	Home: null,
// };

// export async function fetchPartData(pageType: PAGE_TYPE, lang: LANG, params?: {[key: string]: number | string}, data?: HomeData) {
// 	const fetchDataFunc = pageType_fetchPartData_map[pageType];
// 	if (!fetchDataFunc) return null;
// 	setCurrentLang(lang);
// 	return fetchDataFunc(params, data);
// }
